<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>经纪人管理</title>
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
	<meta name="apple-mobile-web-app-capable" content="yes" />
	<meta name="format-detection" content="telephone=no" />
	<link rel="stylesheet" href="../../css/public-heder-Reset.css">
	<link rel="stylesheet" href="../../css/U-gift.css">
</head>
<body>
	<!-- page_box -->
	<div class="page-box">
		<div class="qr-code" style="width:100%;height:100%;position:fixed;background:rgba(0,0,0,0.5);z-index:220;display:none;">
			<div style="width:200px;border-radius:5px;position:absolute;left:50%;top:50%;padding:20px;background:#fff;line-height:20px;font-size:13px;text-align:center;margin:-100px 0 0 -100px">
				<div class="qr-back" style="width:30px;height:30px;font-size:20px;border-radius:15px;position:absolute;top:-12px;right:-8px;background:#fff;line-height:30px;text-align:center;>">×</div>
				<p>邀请好友扫一扫下图二维码</p>
				<div class="demo" style="margin-top:10px;">
					<div id="qrcodeTable" style="display:inline-block;"></div> 	
				</div>
			</div>
		</div>
		<!-- header -->
		<header class="page-header">
			<a href="javascript:history.go(-1)" class="back"></a>
			<p class="pege-name">经纪人管理</p>
		</header>
		<div class="liubai"></div>
		<!-- header /-->
		<!-- button -->
		<div class="agent_data">
			<div class="share_btn clear">
				<div class="agent_text_fr fr">邀请经纪人</div>
				<div class="fl">邀请经纪人注册：</div>
			</div>
			<ul class="data_box clear">
				<li>
					<div class="data_my">
						<p style="">总投资金额<br>（元）</p>
					</div>
					<div class="data_number use_money"></div>
				</li>
				<li>
					<div class="data_my">
						<p style="">总推荐费用<br>（元）</p>
					</div>
					<div class="data_number invite_money"></div>
				</li>
				<li>
					<div class="data_my">
						<p style="">总返利<br>（元）</p>
					</div>
					<div class="data_number return_money"></div>
				</li>
			</ul>
		</div>
		<!-- button / -->
		<!-- more-list -->
		<div class="Envelope-list">
		    <!-- <div class="Envelope">
		        <div class="top clear">
		            <p class="fl">张三&nbsp;&nbsp;JJDJD</p>
		            <span class="fr">+8.00<i>元</i></span>
		        </div>
		        <div class="agent clear" style="color:#999;">
		            <ul>
		            	<li>投资人数(人)</li>
		            	<li>总投资金额(元)</li>
		            	<li>推荐费(元)</li>
		            </ul>
		            <ul>
		            	<li>999</i>
		            	<li>555</li>
		            	<li>555</li>
		            </ul>
		        </div>
		    </div> -->
		</div>
		<!-- more-list/ -->
	</div>
<script type="text/javascript" src="../../js/jquery.min.js"></script>
<script type="text/javascript" src="../../js/http-url.js"></script>
<script type="text/javascript" src="../../js/dropload.js"></script>
<script type="text/javascript" src="../../js/jquery.qrcode.js"></script>
<script type="text/javascript" src="../../js/qrcode.js"></script>
<script type="text/javascript">
	$(function(){
		// 关闭二维码；
		$('.qr-back').click(function(){
			$('.qr-code').hide();	
		});
		// 点击获取；
		$('body').on('click','.Envelope',function(){
			var agent_code=$(this).attr('data-second-agent-code')
			window.location.href='U-agent-list.html?#agent_code='+agent_code+'';
		})
		// ajax请求
		var page_nuber=0;
		$('.page-box').dropload({
	        scrollArea : window,
	        loadDownFn : function(me){
	          ajaxRequest('/api/menu/agent/next/'+page_nuber+'',null,function(data){
	          	$('.invite_money').text(data.data.all.invite_money)//推荐费
	          	$('.return_money').text(data.data.all.return_money)//返利
	          	$('.use_money').text(data.data.all.use_money)//总投资
	          	// 生成二维码
	          	function creat(){
				   $('.qr-code').show();
			       $("#qrcodeTable").html("");
				   $("#qrcodeTable").qrcode({
					render	: "table",
					text	: data.data.all.invite_agent_url,
					width:"150",
					height:"150"
					});
	   			 }
				$('.agent_text_fr').click(function(){
					creat();
				});
	          	page_nuber++;
	            // 判断是否加载完毕
	            if(!data.data.content){
	               // 锁定
	                me.lock();
	              // 无数据
	              me.noData();
	            };
           	 	$(data.data.content).appendTo('.Envelope-list');
           	    me.resetload();
	          },false);  
	        },
	        threshold :50
	    });	
	})
	  	
</script>
</body>
</html>